export default {
    namespaced: true,
    state: {
        //子用户信息
        user: {
            //客户id
            custId: "",
            //集团id
            cliqueId: "",
            //角色id
            groupCode: "",
            //客户类型
            customerType:"",
        }
    },
    getters: {
        /**
         * @description 返回当前的子用户信息
         * @param {*} state vuex state
         */
        user (state) {
            return state.user;
        },
        /**
         * @description 返回子用户信息是否为空
         * @param {*} state vuex state
         */
        isNull(state){
            if(!state.user.custId && !state.user.cliqueId){
                return true;
            }else{
                return false;
            }
        }
    },
    actions: {
    },
    mutations: {
        /**
         * @description 设置子用户信息
         * @param {Object} state vuex state
         * @param {Object} info data
         */
        setUser (state, info) {
            state.user = info;
        },
    }
}
